<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<s:if test="hasActionErrors()">
	<span class="errors"><s:actionerror /></span>
</s:if>

<div id="rightPan">
	<div id="rightbodyPan">
		<div align="center"><p style=" font-size: 24px; padding: 10px 0 5px 0;" >ขนาดเกณฑ์มาตรฐาน โดยแบ่งตามน้ำหนักของสุนัข</p></div>
		<div id="headerTab">
			<a style="width: 80px;" href="<s:url action="size_get" namespace="/admin"/>">เรียกดูข้อมูล</a>
			<a style="width: 120px;"  id="clicked">ค้นหา/แก้ไข ข้อมูล</a>
		</div>
		
		<script type="text/javascript">
			function select(form){
				if ( form.breedSize.value != "" )
				{
					document.getElementById( 'sizeEachBreed' ).value = "";
					document.getElementById( 'size_search1' ).submit();
					//document.getElementById( 'sizeEachBreed' ).disabled = true;
				}
				//document.getElementById("searchBreedId").value = form.breedNameList.value;
			}
			
			function search2(){
				document.getElementById( 'size_search2' ).submit();
			}
			
			function edit()
			{
				document.getElementById( 'size_edit' ).submit();
			}
		</script>
		
		<s:form id="size_search1" action="size_search1" theme="simple" method="post">
			<table>
				<tr>
					<td style="padding-top: 30px; " id="slabel">ขนาดพันธุ์สุนัข:</td>
					<td style="padding-top: 30px;">
						<s:select list="sizes" key="sizeForm.sizes" id="breedSize"
						headerKey="-1" headerValue="" onchange="select(this.form);"/>
					</td>
				</tr>
			</table>
		</s:form>
		
		<s:form id="size_search2" action="size_search2" theme="simple" method="post">
			<table>
				<tr>
					<td id="slabel">เกณฑ์มาตรฐานสำหรับทุกพันธุ์:</td>
					<td>
						<s:select list="sizeEachBreed" key="sizeForm.sizeEachBreed"
						headerKey="-1" headerValue="" id="sizeEachBreed"/>
					</td>
				</tr>
			</table>
			<div style="float: left; margin-right: 200px; ">
				<input onclick="search2()" type="button" value="ค้นหา" id="button"
				style=" margin: 5px 0 0 200px; "></input>
			</div>
		</s:form>
		
		<s:form id="size_edit" action="size_edit" theme="simple" method="post">
			<table>
				<tr>
					<td style="padding-top: 30px; " id="slabel">ช่วงอายุ:</td>
					<td style="padding-top: 30px; " >
						<s:textfield key="sizeForm.startAge" maxlength="2" size="5"/>
						เดือน - <s:textfield key="sizeForm.endAge" maxlength="2" size="5"/>เดือน
					</td>
				</tr>
			</table>
			<div style="float: left; margin-right: 200px; ">
				<input onclick="edit()" type="button" value="แก้ไข" id="button"
				style=" margin: 5px 0 0 200px; "></input>
			</div>
		</s:form>

	</div>
</div>

